package org.jvending.provisioning.webservice.client;

import org.codehaus.xfire.client.XFireProxyFactory;
import org.codehaus.xfire.test.Echo;
import org.codehaus.xfire.service.Service;
import org.codehaus.xfire.service.binding.ObjectServiceFactory;

import java.net.MalformedURLException;

public class DiscoveryServiceClient {

    public void execute() {
        ObjectServiceFactory serviceFactory = new ObjectServiceFactory();
        Service serviceModel = serviceFactory.create(Echo.class);

        XFireProxyFactory proxyFactory = new XFireProxyFactory();
        Echo echo = null;
        try {
            echo = (Echo) proxyFactory.create(serviceModel, "http://localhost:8080/provisioning/");
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }

        System.out.println(echo.echo("Hello World"));

       // starter.stop();
    }
}
